home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FLI106C.ZIP;1 / BLCHFILL.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-12  |  1.2 KB  |  68 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.06c
  4. // Copyright (C) 1990, 1991, 1992
  5. // Software Dimensions
  6. //
  7. // BlazeClass
  8. //
  9.  
  10. #ifndef __BCPLUSPLUS__
  11. #pragma inline
  12. #endif
  13.  
  14. #include "fli.h"
  15.  
  16. #ifdef __BCPLUSPLUS__
  17. #pragma hdrstop
  18. #endif
  19.  
  20. #define I asm
  21.  
  22. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  23. //
  24. // CharacterFill()
  25. //
  26. // Fills a region of the display with a certain character
  27. //
  28. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  29.  
  30. void BlazeClass::CharacterFill(int X,int Y,int Width,int Height,
  31.   int Color,int Character)
  32. {
  33.   if (!Width || !Height || X>=WinWide || Y>=WinHigh)
  34.     return;
  35.  
  36.   int ScreenWidth = BlazeClass::QuickWidth;
  37.   int Locator = ((WinY+Y)*ScreenWidth)+((WinX+X)*2);
  38.  
  39.   if (X+Width>=WinWide)
  40.     Width=WinWide-X;
  41.  
  42.   if (Y+Height>=WinHigh)
  43.     Height=WinHigh-Y;
  44.  
  45.   void far *OUTPUT=BlazeClass::OUTPUT;
  46.   I les di,OUTPUT
  47.   I add di,Locator
  48.  
  49.   I mov bx,[Width]
  50.   I mov dx,[Height]
  51.  
  52.   I mov al,byte ptr Character
  53.   I mov ah,byte ptr Color
  54.  
  55.   I cld
  56.  
  57. looped:
  58.  
  59.   I push di
  60.   I mov cx,bx
  61.   I rep stosw
  62.   I pop di
  63.   I add di,ScreenWidth
  64.   I dec dx
  65.   I or dx,dx
  66.   I jne looped
  67. }
  68.